import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);

// 创建一个对象来保存应用启动时的初始状态
const state = {
  isLoading: false,
  user: {},
  wares: [{}],
  ware: {},
  order: {},
};

const mutations = {
};

const actions = {
};

const getters = {
};

const store = new Vuex.Store({
  state,
  mutations,
  actions,
  getters,
});

//页面加载动画
store.registerModule('vux', { // 名字自己定义
  state: {
    isLoading: false
  },
  mutations: {
    updateLoadingStatus (state, payload) {
      state.isLoading = payload.isLoading
    }
  }
})

export default store;
